import openai # ChatGPT official pacakge

openai.api_key = "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"

# Image generation
response = openai.Image.create(
    prompt = "A red apple on the table.",
    n = 8,
    size = "512x512"
)

print(response['data'][0])
print(response['data'][0]['url'])
